const path = require('path')

function resolve(dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  lintOnSave: true,
  outputDir: 'examples',
  chainWebpack: config => {
    config.resolve.alias
      .set('@', resolve('src'))
      .set('assets', resolve('src/assets'))
      .set('components', resolve('src/modules'))
      .set('utils', resolve('src/utils'))
      .set('common', resolve('src/common'))
  },
  publicPath: process.env.NODE_ENV === 'production' ? './' : './',
  devServer: {
    disableHostCheck: true,
    host: '0.0.0.0',
    hot: true // 开启热更新模块
  }
}
